package cn.goour.utils.http;

import java.util.HashMap;
import java.util.Map;

public class Params {
	private Map<String, Object> params = new HashMap();

	public void add(String key, Object value) {
		this.params.put(key, value);
	}

	public Object getValue(String key) {
		return this.params.get(key);
	}

	public void remove(String key) {
		this.params.remove(key);
	}

	public String getParams() {
		StringBuffer sBuffer = new StringBuffer();
		for (Map.Entry<String, Object> item : this.params.entrySet()) {
			sBuffer.append(item.getKey());
			sBuffer.append("=");
			sBuffer.append(item.getValue());
			sBuffer.append("&");
		}
		return sBuffer.toString();
	}

	public Map<String, Object> getParamsMap() {
		return this.params;
	}

	public String toString() {
		return "Params [params=" + this.params + ", getParams()=" + getParams() + "]";
	}
}